from  flask import Flask
from dooks.views import view
from  models.users import db
from flask_cors import  CORS
def create_flask_app(config):
    app=Flask(__name__)

    # 允许项目中所有请求跨域
    CORS(app)

# 读取配置文件
    app.config.from_object(config)
    # 初始化数据库
    db.init_app(app)

    # 注册蓝图
    app.register_blueprint(view)

    return app

